package com.ubs.training.server.service;

import com.ubs.training.prod.server.service.LoggingService;
import com.ubs.training.server.dao.EmployeeDao;
import com.ubs.training.server.dao.model.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: xubuntu
 * Date: 8/22/12
 * Time: 4:21 AM
 * To change this template use File | Settings | File Templates.
 */
@Service
public class EmployeeService implements IEmployeeService{

    @Resource(name="employeeDao")
    EmployeeDao employeeDao;


    public EmployeeDao getEmployeeDao() {
        return employeeDao;
    }

    public void setEmployeeDao(EmployeeDao employeeDao) {
        this.employeeDao = employeeDao;
    }

    @Override
    public List<Employee> getAllEmployee() {
        //log.logEvent("User request all Employee");
        return employeeDao.getAll();
    }
    @Override
    public Employee getEmployee(int id) {
        //log.logEvent("User request Employee");
        return employeeDao.getById(id);
    }

}
